import 'package:flutter_deer/generated/json/base/json_convert_content.dart';
import 'package:flutter_deer/login/models/register_user_entity.dart';

UpdatePasswordByUsernameEntity $UpdatePasswordByUsernameEntityFromJson(Map<String, dynamic> json) {
  final UpdatePasswordByUsernameEntity updatePasswordByUsernameEntity = UpdatePasswordByUsernameEntity();
  final String? username = jsonConvert.convert<String>(json['username']);
  if (username != null) {
    updatePasswordByUsernameEntity.username = username;
  }
  final String? oldPassword = jsonConvert.convert<String>(json['oldPassword']);
  if (oldPassword != null) {
    updatePasswordByUsernameEntity.oldPassword = oldPassword;
  }
  final String? newPassword = jsonConvert.convert<String>(json['newPassword']);
  if (newPassword != null) {
    updatePasswordByUsernameEntity.newPassword = newPassword;
  }
  return updatePasswordByUsernameEntity;
}

Map<String, dynamic> $UpdatePasswordByUsernameEntityToJson(UpdatePasswordByUsernameEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['username'] = entity.username;
  data['oldPassword'] = entity.oldPassword;
  data['newPassword'] = entity.newPassword;
  return data;
}

RegisterUserEntity $RegisterUserEntityFromJson(Map<String, dynamic> json) {
  final RegisterUserEntity registerUserEntity = RegisterUserEntity();
  final String? mobile = jsonConvert.convert<String>(json['mobile']);
  if (mobile != null) {
    registerUserEntity.mobile = mobile;
  }
  final String? code = jsonConvert.convert<String>(json['code']);
  if (code != null) {
    registerUserEntity.code = code;
  }
  final String? shareCode = jsonConvert.convert<String>(json['shareCode']);
  if (shareCode != null) {
    registerUserEntity.shareCode = shareCode;
  }
  final String? password = jsonConvert.convert<String>(json['password']);
  if (password != null) {
    registerUserEntity.password = password;
  }
  return registerUserEntity;
}

Map<String, dynamic> $RegisterUserEntityToJson(RegisterUserEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['mobile'] = entity.mobile;
  data['code'] = entity.code;
  data['shareCode'] = entity.shareCode;
  data['password'] = entity.password;
  return data;
}

UserPerfectEntity $UserPerfectEntityFromJson(Map<String, dynamic> json) {
  final UserPerfectEntity userPerfectEntity = UserPerfectEntity();
  final String? phone = jsonConvert.convert<String>(json['phone']);
  if (phone != null) {
    userPerfectEntity.phone = phone;
  }
  final String? avatar = jsonConvert.convert<String>(json['avatar']);
  if (avatar != null) {
    userPerfectEntity.avatar = avatar;
  }
  final String? nickname = jsonConvert.convert<String>(json['nickname']);
  if (nickname != null) {
    userPerfectEntity.nickname = nickname;
  }
  return userPerfectEntity;
}

Map<String, dynamic> $UserPerfectEntityToJson(UserPerfectEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['phone'] = entity.phone;
  data['avatar'] = entity.avatar;
  data['nickname'] = entity.nickname;
  return data;
}